package com.tbit.uqbike.enums;

/**
 * 车辆标签-操作类型
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/7/12
 */
public enum TagOperationType {
    ADD_BY_MACHINE_NO("addByMachineNo","machineNo"),
    ADD_BY_ACCOUNT_ID("addByAccountId","accountId"),

    ADD_BY_MACHINE_ID("addByMachineId","machineId"),

    ADD_BY_USER_CODE("addByUserCode","userCode"),

    CANCEL_BY_MACHINE_NO("cancelByMachineNo","machineNo"),

    CANCEL_BY_ACCOUNT_ID("cancelByAccountId","accountId"),

    CANCEL_BY_MACHINE_ID("cancelByMachineId","machineId"),

    CANCEL_BY_USER_CODE("cancelByUserCode","userCode");

    private String operationType;

    private String operationInfo;

    TagOperationType(String operationType,String operationInfo) {
        this.operationType = operationType;
        this.operationInfo = operationInfo;
    }

    public String getOperationType() {
        return operationType;
    }

    public String getOperationInfo() {
        return operationInfo;
    }

    public static TagOperationType getTagOperationType(String operationType) {
        for (TagOperationType tagOperationType : TagOperationType.values()) {
            if (tagOperationType.getOperationType().equals(operationType)) {
                return tagOperationType;
            }
        }
        return null;
    }

    public static TagOperationType getTagOperationTypeByOperationInfo(String operationInfo) {
        for (TagOperationType tagOperationType : TagOperationType.values()) {
            if (tagOperationType.getOperationInfo().equals(operationInfo)) {
                return tagOperationType;
            }
        }
        return null;
    }
}
